using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using MAPDavy.Entities;

namespace MAPDavy.Repository.Mapping
{
	public class GradeMap : EntityTypeConfiguration<Grade>
	{
		public GradeMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.GradeLevel)
				.IsRequired()
				.HasMaxLength(20);
				
			this.Property(t => t.Description)
				.HasMaxLength(250);
				
			// Table & Column Mappings
			this.ToTable("Grade");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.GradeLevel).HasColumnName("GradeLevel");
			this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.Nivel).HasColumnName("Nivel");
		}
	}
}

